home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / CRS / crs32.d81 / examples.arc / CSET.A < prev    next >
Text File  |  1989-12-01  |  4KB  |  129 lines

  1. ; cset.a
  2. ;------------------------------------------------------------
  3. ; Initialize Character Set to allow for special C characters
  4. ;------------------------------------------------------------
  5.  
  6. index2      =   $0026
  7. index1      =   $0024
  8. int0e       =   $170e
  9.  
  10.             dw  $0b00
  11.             * = $0b00
  12.  
  13. CharInit    lda #$43                ;Access ROM character set (bank 14)
  14.             sta $ff00
  15.             ldy #<$4800
  16.             sty index2
  17.             sty index1
  18.             lda #>$d800
  19.             sta index2+1
  20.             lda #>$4800
  21.             sta index1+1
  22. Chi00       lda (index2),y          ;Copy charset into RAM
  23.             sta (index1),y
  24.             iny                     
  25.             bne Chi00
  26.             inc index2+1
  27.             inc index1+1
  28.             lda index2+1
  29.             cmp #>$e000
  30.             bne Chi00
  31.  
  32.             lda #6                  ;6 chars to modify
  33.             sta temp1
  34.             ldx #0                  
  35. Chi01       lda Cchars,x
  36.             inx                     
  37.             sta index2
  38.             sta index1
  39.             lda Cchars,x
  40.             inx                     
  41.             sta index2+1
  42.             clc                     
  43.             adc #4                  
  44.             sta index1+1
  45.             ldy #0                  
  46. Chi02       lda Cchars,x
  47.             inx                     
  48.             sta (index2),y
  49.             eor #$ff                
  50.             sta (index1),y
  51.             iny                     
  52.             cpy #8                  
  53.             bne Chi02
  54.             dec temp1
  55.             bne Chi01
  56.  
  57.             lda #$42                ;Enable I/O
  58.             sta $ff00
  59.             lda #<$4800             ;And copy chrset to the VDC
  60.             sta index2
  61.             lda #>$4800
  62.             sta index2+1
  63.             lda #1                  
  64.             sta temp2
  65.             ldx #$12                
  66.             lda #$20                
  67.             jsr VDCpoke
  68.             inx                     
  69.             lda #0                  
  70.             jsr VDCpoke
  71.             ldy #0                  
  72. Chi03       lda (index2),y
  73.             ldx #$1f                
  74.             jsr VDCpoke
  75.             iny                     
  76.             cpy #8                  
  77.             bne Chi03
  78.             lda #0                  
  79. Chi04       ldx #$1f
  80.             jsr VDCpoke
  81.             dey                     
  82.             bne Chi04
  83.             clc                     
  84.             lda index2
  85.             adc #8                  
  86.             sta index2
  87.             bcc Chi06
  88.             inc index2+1
  89.             lda index2+1
  90.             cmp #>$5000
  91.             bne Chi06
  92.             lda temp2
  93.             bne Chi05
  94.             jmp int0e
  95.  
  96. Chi05       lda #>$4800
  97.             sta index2+1
  98.             dec temp2
  99. Chi06       jmp Chi03
  100.  
  101. VDCpoke     stx $d600
  102. VDCp0       bit $d600
  103.             bpl VDCp0
  104.             sta $d601
  105.             rts                     
  106.  
  107. ;----------------------------------------------
  108. ; Data for redefined characters ( {,},|,~ etc)
  109. ;----------------------------------------------
  110.  
  111. Cchars      dw $4ad8
  112.             db $0c, $18, $18, $30, $18, $18, $0c, $00
  113.             dw $4ae8
  114.             db $30, $18, $18, $0c, $18, $18, $30, $00
  115.             dw $4b78
  116.             db $00, $00, $00, $3b, $6e, $00, $00, $00
  117.             dw $4b20
  118.             db $00, $00, $00, $00, $00, $00, $00, $7e
  119.             dw $4af8
  120.             db $18, $18, $18, $18, $18, $18, $18, $00
  121.             dw $48e0
  122.             db $00, $60, $30, $18, $0c, $06, $03, $00
  123.  
  124. temp1       db 0
  125. temp2       db 0
  126.  
  127.             .end                    
  128.                                     
  129.